
package testGestionJeu;

import action.Action;
import action.DeplacerMouton;
import controlleur.GestionJeu;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import modele.Berger;
import modele.Bergerie;
import modele.Champ;
import modele.Mouton;
import modele.Partie;
import modele.Passage;
import org.junit.After;
import org.junit.AfterClass;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

/**
 *
 * @author DONG Xiangxiang Durand Rémi
 */
public class testGestionJeu {
    
    private Partie partie;
    private Berger b1;
    private Berger b2;
    
    public testGestionJeu() {
        Bergerie bergerie = new Bergerie();
        List<Berger> bergers = new ArrayList<Berger>();
        
        b1 = new Berger("1");
        b2 = new Berger("2");
        
        bergers.add(b1);
        bergers.add(b2);
        
        partie = new Partie(bergerie, bergers);
        
        Action action = new DeplacerMouton(new Mouton(), new Champ());
        
        partie.ajouterActionBerger(b1, action);
    }
    

    
    @Test
    public void testVerifierPositionnerBarriereTrue(){
        Passage passage = new Passage();
        
        boolean result = GestionJeu.verifierPositionnerBarriere(partie, b1, passage);
        assertEquals(true, result);       
    }
    
    //@Test
    public void testVerifierPositionnerBarriereFalse(){
        Passage passage = new Passage();
        passage.setDisponible(false);
        
        boolean result = GestionJeu.verifierPositionnerBarriere(partie, b1, passage);
        assertEquals(false, result);
    }
    
    //@Test
    public void testVerifierDeplacementMoutonFalse(){
        boolean result = GestionJeu.verifierDeplacementMouton(partie, b1, new Mouton(new Champ(), b1), new Champ());
        
        assertEquals(false, result);
    }
    
    @BeforeClass
    public static void setUpClass() {
    }
    
    @AfterClass
    public static void tearDownClass() {
    }
    
    @Before
    public void setUp() {
    }
    
    @After
    public void tearDown() {
    }

    // TODO add test methods here.
    // The methods must be annotated with annotation @Test. For example:
    //
    // @Test
    // public void hello() {}
}
